# -*- coding: utf-8 -*-

'''
@project : AIGateWay_fastapi
@FileName: redis_connecter
@Author  :linych 
@Time    :2020/12/16 21:57
@Desc  : 
'''





import redis
from Core import conf


TASK =  6
PARAM = 7
VIDEO = 8
PICTURE = 9

redis_con_dict = {}

TASK_NAME = 'TASK_smarthome_test_0301'



host = conf.get('REDIS','host')
port = conf.get("REDIS",'port')
password = conf.get("REDIS",'password')



TASK_pool = redis.ConnectionPool(host=host, port=port, decode_responses=True,db=TASK,password=password)
redis_con_dict[TASK] = redis.StrictRedis(connection_pool=TASK_pool)

PARAM_pool = redis.ConnectionPool(host=host, port=port, decode_responses=True,db=PARAM,password=password)
redis_con_dict[PARAM] = redis.StrictRedis(connection_pool=PARAM_pool)

VIDEO_pool = redis.ConnectionPool(host=host, port=port, decode_responses=True,db=VIDEO,password=password)
redis_con_dict[VIDEO] = redis.StrictRedis(connection_pool=VIDEO_pool)

PICTURE_pool = redis.ConnectionPool(host=host, port=port, decode_responses=True,db=PICTURE,password=password)
redis_con_dict[PICTURE] = redis.StrictRedis(connection_pool=PICTURE_pool)






